package com.example.springioc1.config;

import com.example.springioc1.model.UserInfo;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

@Configuration
public class BeanConfig {
    @Primary//设置默认的Bean
    @Bean
    public UserInfo getUserInfo(){
        return new UserInfo("zhangsan");
    }
    @Bean
    public UserInfo getUserInfo1(){
        return new UserInfo("lisi");
    }
    @Bean
    public UserInfo getUserInfo2(){
        return new UserInfo("wangwu");
    }
}
